echo check_schema_detail 
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 -e "truncate table check_schema_detail"
D:\mysql56\bin\mysqldump --lock-tables=false -t -uroot -pxxx mes check_schema_detail > check_schema_detail.sql
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 < check_schema_detail.sql

echo menu_tmplate 
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 -e "truncate table menu_tmplate"  
D:\mysql56\bin\mysqldump --lock-tables=false -t -uroot -pxxx mes menu_tmplate > menu_tmplate.sql
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 < menu_tmplate.sql


echo check_log 
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 -e "delete from check_log where dt between DATE_FORMAT(curdate()-interval 1 day,'%%Y-%%m-%%d %%H:%%i:%%s') and DATE_FORMAT(curdate()-interval 1 second,'%%Y-%%m-%%d %%H:%%i:%%s')"  
D:\mysql56\bin\mysqldump --lock-tables=false -t -uroot -pxxx mes check_log --where=" dt between DATE_FORMAT(curdate()-interval 1 day,'%%Y-%%m-%%d %%H:%%i:%%s') and DATE_FORMAT(curdate()-interval 1 second,'%%Y-%%m-%%d %%H:%%i:%%s')" > check_log.sql
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 < check_log.sql   

echo check_log_detail 
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 -e "delete from check_log_detail where dt between DATE_FORMAT(curdate()-interval 1 day,'%%Y-%%m-%%d %%H:%%i:%%s') and DATE_FORMAT(curdate()-interval 1 second,'%%Y-%%m-%%d %%H:%%i:%%s')"  
D:\mysql56\bin\mysqldump --lock-tables=false -t -uroot -pxxx mes check_log_detail --where=" dt between  DATE_FORMAT(curdate()-interval 1 day,'%%Y-%%m-%%d %%H:%%i:%%s') and DATE_FORMAT(curdate()-interval 1 second,'%%Y-%%m-%%d %%H:%%i:%%s')" > check_log_detail.sql
D:\mysql56\bin\mysql -uroot -pxxx -h10.10.10.11 mes1 < check_log_detail.sql 


D:\mysql56\bin\mysql -uroot -pxxx -e "SELECT now() as now_time,table_schema,TABLE_NAME,ROUND(SUM(DATA_LENGTH + INDEX_LENGTH)/POWER(1024,3),2) gbs FROM information_schema.TABLES where table_schema='mes' GROUP BY table_schema,TABLE_NAME ORDER BY gbs" > daily_spaceinfo.txt


copy *.txt D:\DBA\sync2baiduyun\blat3215\full\


set from=zhangyu@tt.com
set user=zhangyu@tt.com
set pass=xxx
set to=zhangyu@tt.com
set subj=sync2baiduyun_log
set mail=D:\DBA\sync2baiduyun\blat3215\full\daily_error_log.txt
set attach=D:\DBA\sync2baiduyun\blat3215\full\*.txt
set server=mail.xxx.com
set debug=-debug -log blat.log -timestamp

D:\DBA\sys2aliyun\blat3215\full\blat %mail% -to %to% -base64 -attach %attach% -charset UTF8 -subject %subj% -server %server% -f %from% -u %user% -pw %pass% %debug%